#ifndef DOM_POLICY_H
#define DOM_POLICY_H

#include <iksemel.h>
#include <boost/shared_ptr.hpp>
#include "dom.h"

namespace model {
	/**
	 * This class is a policy for the parser-class, which creates a 
	 * dom-parser.
	 * \author Michael Opitz <opitz.michael@gmail.com>
	 * \version 0.1
	 */
	class dom_policy {
	public:
		/**
		 * Does basically nothing.
		 */
		dom_policy();
		/**
		 * Does basically nothing.
		 */
		~dom_policy();

		/**
		 * This method is called by the inherited parser-class
		 * and creates a dom-parser.
		 * \return a iksparser-object is returned.
		 */
		iksparser* create();

		/**
		 * This method returns the dom-tree for the parsed xml-string.
		 * \return A pointer to the dom-node is returned.
		 */
		boost::shared_ptr<model::dom> get_node() {return node;}
		/**
		 * This method returns the dom-tree for the parsed xml-string.
		 * \return A pointer to the dom-node is returned.
		 */
		const boost::shared_ptr<model::dom> get_node() const 
		{
			return node;
		}
	private:
		/**
		 * This attribute stores a shared-pointer to the dom-node.
		 */
		boost::shared_ptr<model::dom> node;
	};
}
#endif
